<html>
<head>
    <meta charset="utf-8">
    <title>仪表盘</title>
    <!-- 引入 echarts.js -->
    <script src="./echarts.min.js"></script>
</head>
<body>
    <div id="main" style="width: 660px;height:420px;"></div>
    <script type="text/javascript">
        var myChart = echarts.init(document.getElementById('main'));

        option = {
            tooltip: {
                formatter: '{a} <br/>{b} : {c}%'
            },
            toolbox: {
                feature: {
                    restore: {},
                    //saveAsImage: {}
                }
            },
            series: [
                {
                    name: '业务指标',
                    type: 'gauge',
                    detail: {formatter: '{value}%'},
                    data: [{value: 50, name: '完成率'}]
                }
            ]
        };

        setInterval(function () {
            option.series[0].data[0].value = (Math.random() * 100).toFixed(2) - 0;
            myChart.setOption(option, true);
        },2000);

        myChart.setOption(option);
    </script>
</body>
</html>
